<extend name="Common:sysTemplate" />
<block name="content">
<div class="Item hr">
    <div class="current">数据库中共有{$list|count}张表，共计{$totalsize.table|byteFormat}</div>
</div>
<form>
    <table width="100%" border="0" cellspacing="0" cellpadding="0"  class="table_list">
        <thead>
            <tr>
                <td width="90"><input type="checkbox" onclick="clickCheckbox(this)"/></td>
                <td>表名</td>
                <td>表用途</td>
                <td>记录行数</td>
                <td>引擎类型</td>
                <td>字符集</td>
                <td>碎片</td>
                <td>表大小</td>
                <td>数据</td>
                <td>索引</td>
            </tr>
        </thead>
        <tbody>
            <volist name="list" id="tab">
                <tr align="center">
                    <td><input type="checkbox" name="table[]" value="{$tab.Name}"/></td>
                    <td align="left">{$tab.Name}</td>
                    <td>{$tab.Comment}</td>
                    <td>{$tab.Rows}</td>
                    <td>{$tab.Engine}</td>
                    <td>{$tab.Collation}</td>
                    <td>{$tab.Data_free}</td>
                    <td>{$tab.size}</td>
                    <td>{$tab.Data_length}</td>
                    <td>{$tab.Index_length}</td>
                </tr>
            </volist>
        </tbody>
        <tfoot align="center">
            <tr>
                <td width="90"><input type="checkbox" onclick="clickCheckbox(this)"/></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td><b>{$totalsize.free|byteFormat}</b></td>
                <td><b>{$totalsize.table|byteFormat}</b></td>
                <td><b>{$totalsize.data|byteFormat}</b></td>
                <td><b>{$totalsize.index|byteFormat}</b></td>
            </tr>
        </tfoot>
    </table>
    <input type="hidden" name="act" id="act" />
</form>
<div class="commonBtnArea" >
    <button class="btn optimize">优化所选</button>
    <button class="btn repair">修复所选</button>
</div>
</block>
<block name="footjs">
<script type="text/javascript">
$(function(){
        var handle=function(act){
            if($("tbody input[type='checkbox']:checked").size()==0){
                $.jBox.tip("请先选择你要优化的数据库表吧");
                return false;
            }
            $("#act").val(act);
            commonAjaxSubmit();
        }
        $(".optimize").click(function(){ handle("optimize"); });
        $(".repair").click(function(){  handle("repair"); });
});
</script>
</block>